package com.ygqh.baby.mapper;

import com.ygqh.baby.ao.BargainGenerationMode;
import com.ygqh.baby.ao.JobStatus;
import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.model.UserBargainInfo;
import com.ygqh.baby.po.YgUserBargain;
import com.ygqh.baby.po.YgUserBargainExample;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public interface YgUserBargainMapper {
    int countByExample(YgUserBargainExample example);

    int deleteByExample(YgUserBargainExample example);

    int deleteByPrimaryKey(Long id);

    int insert(YgUserBargain record);

    int insertSelective(YgUserBargain record);

    List<YgUserBargain> selectByExample(YgUserBargainExample example);

    YgUserBargain selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") YgUserBargain record, @Param("example") YgUserBargainExample example);

    int updateByExample(@Param("record") YgUserBargain record, @Param("example") YgUserBargainExample example);

    int updateByPrimaryKeySelective(YgUserBargain record);

    int updateByPrimaryKey(YgUserBargain record);

    int countSuper(@Param("productId") Long productId, @Param("bargainId") Long bargainId, @Param("userId") Long userId, @Param("q") String q,
                   @Param("platformNo") String platformNo);

    List<YgUserBargain> selectSuper(@Param("queryInfo") QueryInfo queryInfo, @Param("productId") Long productId, @Param("bargainId") Long bargainId,
                                    @Param("userId") Long userId, @Param("q") String q, @Param("platformNo") String platformNo);

    UserBargainInfo selectUserBargainInfo(@Param("userBargainId") Long userBargainId);

    int updateCutPrice(@Param("preCutPrice") BigDecimal preCutPrice, @Param("thisCutPrice") BigDecimal thisCutPrice,
                       @Param("lastCutCount") Long lastCutCount, @Param("userBargainId") Long userBargainId);

    List<YgUserBargain> selectUserBargainSuper(@Param("queryInfo") QueryInfo queryInfo, @Param("userBargainId") Long userBargainId,
                                               @Param("userName") String userName, @Param("productName") String productName, @Param("startDate") Date startDate, @Param("endDate") Date endDate,
                                               @Param("status") String status, @Param("q") String q);

    int countUserBargainSuper(@Param("userBargainId") Long userBargainId, @Param("userName") String userName, @Param("productName") String productName,
                              @Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("status") String status, @Param("q") String q);

    int selectOrderCountByBargainId(@Param("userId") Long userId, @Param("bargainId") Long bargainId);

    int updateUserBargainStatusComplete(@Param("userBargainId") Long userBargainId, @Param("generationMode") BargainGenerationMode generationMode);

    int updateRunningUserBargainStatusFinish(@Param("bargainId") Long bargainId, @Param("productId") Long productId,
                                             @Param("remark") String remark, @Param("updateTime") Date updateTime);

    List<String> getUserPhoneList(@Param("bargainId") Long bargainId, @Param("productId") Long productId, @Param("bargainStatus") JobStatus bargainStatus);

}
